home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / musicali / splib52d.lha / superplay-lib_DEV / Programmers / Oberon-2 / Interfaces / SuperPlay.mod < prev    next >
Text File  |  1996-11-15  |  8KB  |  257 lines

  1. (********************************************************************
  2.  
  3. :Program.     SuperPlay.mod
  4. :Contents.    interface module for superplay.library
  5. :Copyright.   © 1994 by Andreas R. Kleinert
  6. :Language.    Oberon-2
  7. :Translator.  A+L Amiga Oberon Compiler V3.11d
  8. :History.     V4.1  indy  23-Dec-95 first translation of c include
  9. *********************************************************************)
  10.  
  11. MODULE SuperPlay;
  12.  
  13. (* $VER: SuperPlay 4.1 (23.12.95)
  14.  
  15.  * !!! IMPORTANT NOTE !!!
  16.  * Before procedures of this module may be used, you have to check
  17.  * SuperPlay.base#NIL because opening SuperPlay fails on Amigas without
  18.  * SuperPlay.library V4.0+.
  19.  
  20.  * If you want to use procedures of this module which needs
  21.  * SuperPlay.library > V4.0 you have to check SuperPlay.base.libNode.version
  22.  * (SuperPlay.LibVer()).
  23.  
  24.  Example:
  25.  --------
  26.    IMPORT
  27.      sp: SuperPlay,
  28.      io;
  29.  
  30.    BEGIN
  31.      IF sp.base=NIL THEN
  32.        io.WriteString ("I need SuperPlay.library V4.0+\n"); END;
  33.  
  34.      (* Example for Version >= V4.0+ check *)
  35.  
  36.      IF  sp.LibVer(sp.base)<5 THEN
  37.        io.WriteString ("I need SuperPlay.library V4.0+\n"); END;
  38.      END;
  39.  
  40.  
  41.   This Oberon-2 interface module contains the c-includes:
  42.   -------------------------------------------------------
  43.     superplay/superplaybase.h
  44.       Version    : 1.1
  45.       Date       : 06.01.1994
  46.       Written by : Andreas R. Kleinert
  47.  
  48.     superplay/superplay.h
  49.       Version    : 4.1
  50.       Date       : 27.11.1994
  51.       Written by : Andreas R. Kleinert
  52. *)
  53.  
  54.  
  55. IMPORT
  56.   e   *: Exec,
  57.   d   *: Dos,
  58.   i   *: Intuition,
  59.  
  60.   spo *: spObjects;
  61. (*****************************************************************************)
  62.  
  63.  
  64. CONST
  65.   name     - = "superplay.library";
  66.  
  67.   (***************************************
  68.    *  superplay/superplay.h              *
  69.    *    Version    : 4.1                 *
  70.    *    Date       : 27.11.1994          *
  71.    *    Written by : Andreas R. Kleinert *
  72.    ****************************************)
  73.  
  74.   (***************************************************
  75.    *                                                 *
  76.    * Version Defines                                 *
  77.    *                                                 *
  78.    ***************************************************)
  79.  
  80.   libVersion = 4;
  81.  
  82.  
  83.   (***************************************************
  84.    *                                                 *
  85.    * MACROs for Version-Tests                        *
  86.    *                                                 *
  87.    ***************************************************)
  88.  
  89. PROCEDURE LibVer*(lib: e.LibraryPtr): INTEGER;
  90.  
  91. BEGIN
  92.   RETURN lib.version;
  93. END LibVer;
  94.  
  95.  
  96. PROCEDURE OSVer*(): INTEGER;
  97.  
  98. BEGIN
  99.   RETURN LibVer(e.SysBase);
  100. END OSVer;
  101.  
  102.  
  103. TYPE
  104.   SuperPlayBasePtr * = UNTRACED POINTER TO SuperPlayBase;
  105.  
  106.   (***************************************************
  107.    *                                                 *
  108.    * DEFINES                                         *
  109.    *                                                 *
  110.    ***************************************************)
  111.  
  112.  
  113. (* Possible FileTypes *)
  114.  
  115. CONST
  116.   filetypeNone    - = 0;
  117.   filetypeUnknown - = filetypeNone;
  118.  
  119.      (*
  120.         above : External, user defined FileTypes
  121.                 (defined EACH TIME NEW at Library's startup-time).
  122.      *)
  123.  
  124.   filetypeIllegal - = 0FFFFFFFFH;
  125.  
  126.  
  127. (* Possible SubTypes of FileTypes *)
  128.  
  129.   subtypeNone     - = 0;
  130.   subtypeUnknown  - = subtypeNone;
  131.  
  132.      (*
  133.         above : External, user defined FileSubTypes
  134.                 (defined EACH TIME NEW at Library's startup-time).
  135.      *)
  136.  
  137.   subtypeIllegal  - = 0FFFFFFFFH;
  138.  
  139.  
  140. (* Possible Input and Output mediums *)
  141.  
  142.   mediumNone      - = 0;
  143.   mediumIllegal   - = 0FFFFFFFFH;
  144.  
  145.   mediumDisk      - = 1;              (* Play and Write options   *)
  146.   mediumClip      - = 2;
  147.  
  148.      (* might not be supported by all kinds of File(Sub)Types *)
  149.  
  150.  
  151.   (***************************************************
  152.    *                                                 *
  153.    * Function Error Codes                            *
  154.    *                                                 *
  155.    ***************************************************)
  156.  
  157.   errMaxErrorTextLength - = 80;    (* plus Null-Byte *)
  158.  
  159.   errNoError            - =  0;
  160.   errInternalError      - =  0FFFFFFFFH;
  161.  
  162.   errUnknownFileFormat  - =  1;
  163.   errFileNotFound       - =  2;
  164.   errNoMemory           - =  3;
  165.   errIFFParseError      - =  4;
  166.   errNoClipboard        - =  5;
  167.   errNoFile             - =  6;
  168.   errNoHandle           - =  7;
  169.   errNoData             - =  8;
  170.   errNoInformation      - =  9;
  171.   errIllegalAccess      - = 10;
  172.   errDecodeError        - = 11;
  173.   errUnknownParameters  - = 12;
  174.   errActionNotSupported - = 13;
  175.   errNoChannels         - = 14;
  176.   errVersionConflict    - = 15;
  177.   errNoSamplesLoaded    - = 16;
  178.  
  179.         (* Each new Library-Subversion may contain new Codes above
  180.            the last one of these.
  181.            So do not interpret the codes directly, but use
  182.            SPL_GetErrorString.
  183.            Maybe, newer Codes might not be listed up here.
  184.         *)
  185.  
  186.  
  187. (************************************
  188.  * superplay/superplaybase.h        *
  189.  * Version    : 1.1                 *
  190.  * Date       : 06.01.1994          *
  191.  * Written by : Andreas R. Kleinert *
  192.  ************************************)
  193.  
  194.    (*
  195.       Except the Library-Bases and the SPObjectList, you should NEVER access
  196.       the entries inside SuperPlayBase directly.
  197.       All other entries are "just for info".
  198.  
  199.       spObjectList is define as read- and writeable because with
  200.       Oberon V3.11d its not possible to get the address of a read only
  201.       variable with SYSTEM.ADR().
  202.    *)
  203.  
  204. TYPE
  205.   SuperPlayBase   - = STRUCT (libNode - : e.Library)
  206.     segList       - : e.APTR;
  207.     sysBase       - : e.ExecBasePtr;
  208.     dosBase       - : d.DosLibraryPtr;
  209.     intuitionBase - : i.IntuitionBasePtr;
  210.     spObjectList  * : e.List;
  211.     private1      - : LONGINT;
  212.     private2      - : LONGINT;
  213.   END;
  214.  
  215.  
  216. VAR
  217.   base -: SuperPlayBasePtr;
  218.  
  219.  
  220. (*  Functions available since Version 1 *)
  221.  
  222. PROCEDURE AllocHandle     * {base, - 30} (future{9}: e.APTR): e.APTR;
  223. PROCEDURE FreeHandle      * {base, - 36} (handle{9}: e.APTR);
  224. PROCEDURE StopReplay      * {base, - 42} (handle{9}: e.APTR);
  225. PROCEDURE FreeResources   * {base, - 48} (handle{9}: e.APTR);
  226. PROCEDURE SuperPlay       * {base, - 54} (handle{9}: e.APTR; filename{10}: ARRAY OF CHAR): LONGINT;
  227. PROCEDURE SuperWrite      * {base, - 60} (handle{9}, sourceHandle{10}: e.APTR): LONGINT;
  228. PROCEDURE InitHandleAsDOS * {base, - 66} (handle{9}, future{10}: e.APTR): LONGINT;
  229. PROCEDURE InitHandleAsClip* {base, - 72} (handle{9}, future{10}: e.APTR): LONGINT;
  230. PROCEDURE SetWriteType    * {base, - 78} (handle{9}: e.APTR; writeType{10}: LONGINT; future{11}: e.APTR): LONGINT;
  231. PROCEDURE GetErrorString  * {base, - 84} (errorCode{9}: LONGINT): e.STRPTR;
  232. PROCEDURE SetWriteName    * {base, - 90} (handle{9}: e.APTR; writeName{10}: ARRAY OF CHAR; future{11}: e.APTR): LONGINT;
  233. PROCEDURE FileInfoRequest * {base, - 96} (handle{9}: e.APTR; window{10}: i.WindowPtr; future{11}: e.APTR): LONGINT;
  234. PROCEDURE SetReqIOWindow  * {base, -102} (handle{9}: e.APTR; window{10}: i.WindowPtr): LONGINT;
  235. PROCEDURE ReadPlayData    * {base, -108} (handle{9}: e.APTR; filename{10}: ARRAY OF CHAR): LONGINT;
  236. PROCEDURE ContinueReplay  * {base, -114} (handle{9}: e.APTR): LONGINT;
  237. PROCEDURE FastForward     * {base, -120} (handle{9}: e.APTR): LONGINT;
  238. PROCEDURE FastBackward    * {base, -126} (handle{9}: e.APTR): LONGINT;
  239.  
  240. (* Functions added with Version 2 *)
  241.  
  242. PROCEDURE GetSampleList   * {base, -132} (handle{9}: e.APTR; list{10}: UNTRACED POINTER TO spo.SampleListPtr): LONGINT;
  243. PROCEDURE SetSampleList   * {base, -138} (handle{9}: e.APTR; list{10}: spo.SampleListPtr): LONGINT;
  244.  
  245. (* Functions added with Version 4 *)
  246.  
  247. PROCEDURE GetFileType     * {base, -144} (handle{9}: e.APTR; filename{10}: ARRAY OF CHAR; fileType{11}: UNTRACED POINTER TO LONGINT): LONGINT;
  248.  
  249.  
  250. BEGIN
  251.   base :=  e.OpenLibrary(name, 4);
  252.  
  253. CLOSE
  254.   IF base#NIL THEN e.CloseLibrary(base) END;
  255.  
  256. END SuperPlay.
  257.